package com.oceanread.cn.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.oceanread.cn.entity.Treelist2;
import com.oceanread.cn.mapper.Treelist2Mapper;
import com.oceanread.cn.service.ITreelist2Service;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ITreelist2ServiceImpl extends ServiceImpl<Treelist2Mapper, Treelist2> implements ITreelist2Service {
    public List<Treelist2> getall() {
        return baseMapper.getall();
    }

    public List<Treelist2> query(String key, String value) {
        return baseMapper.query(key, value);
    }

    public List<Treelist2> equal(String key, String value) {
        return baseMapper.equal(key, value);
    }

    @Override
    public List<Treelist2> getTablelist(int page, int size) {
        return baseMapper.getTablelist((page - 1) * size, size);
    }

    @Override
    public List<Treelist2> getTablelistquery(String key, String value, int page, int size) {
        return baseMapper.getTablelistquery(key, value, (page - 1) * size, size);
    }

    @Override
    public Integer getnum() {
        return baseMapper.getnum();
    }

    @Override
    public Integer getnumquery(String key, String value) {
        return baseMapper.getnumquery(key, value);
    }

    @Override
    public Integer update(Treelist2 treelist2) {
        return baseMapper.update(
                treelist2.getSysid(), treelist2.getpId(), treelist2.getId(), treelist2.getName(),
                treelist2.getPath(), treelist2.getType(),
                treelist2.getTyperoot(), treelist2.getLayers(),
                treelist2.getOpen(),
                treelist2.getEnablePickFeatures(),
                treelist2.getInfluencechild(),
                treelist2.getChecked(),
                treelist2.getLon(), treelist2.getLat(),
                treelist2.getHeight(),treelist2.getHeading(),
                treelist2.getPitch(),treelist2.getRoll());
    }

    @Override
    public int insert(String pId,
                      String id,
                      String Name,
                      String path,
                      String type,
                      String typeroot,
                      String layers,
                      Boolean open,
                      Boolean enablePickFeatures,
                      Boolean influencechild,
                      Boolean checked,
                      Double Lon,
                      Double Lat,
                      Double Height,
                      Double heading,
                      Double pitch,
                      Double roll
    ) {
        return baseMapper.insert(
                pId,
                id,
                Name,
                path,
                type,
                typeroot,
                layers,
                open,
                enablePickFeatures,
                influencechild,
                checked,
                Lon,
                Lat,
                Height,
                heading,
                pitch,
                roll
        );
    }

    public Integer delete(int SYSID) {
        return baseMapper.delete(SYSID);
    }
}
